package com.pyramid.adapter;

import java.util.ArrayList;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;

public class SomePagerAdapter extends PagerAdapter {
	ArrayList<View> manyView;

	public SomePagerAdapter(ArrayList<View> manyView) {
		this.manyView = manyView;
	}

	public int getCount() {
		return manyView.size();
	}

	public Object instantiateItem(View collection, int position) {
		((ViewPager) collection).addView(manyView.get(position), 0);
		return manyView.get(position);
	}

	public void destroyItem(View collection, int position, Object view) {
		((ViewPager) collection).removeView(manyView.get(position));
	}

	public boolean isViewFromObject(View view, Object object) {
		return view == (object);
	}
}
